log

fun log(message: String? = null, error: Throwable? = null, lazyMessage: () -> String? = null, showTimestamp: Boolean = showTimestamps)

Log a message to the log file, console, or some other mechanism.

Parameters

message

The message as a String that is to be logged

error

Throwable object which can have its stack trace written to the log

lazyMessage

A lambda which returns the String to be logged. This can be provided so that the message string is only constructed if logging is enabled for this message type

showTimestamp

Boolean indicating whether a timestamp should be prepended to the message string. Default = true


fun log(message: String)
fun log(message: String, error: Throwable)
fun log(message: String, error: Throwable, showTimestamp: Boolean)
fun log(lazyMessage: () -> String)
fun log(lazyMessage: () -> String, error: Throwable)
fun log(lazyMessage: () -> String, error: Throwable, showTimestamp: Boolean)
fun log(error: Throwable)